/*
 *  display.c
 *
 *  $Id: display.c 7 2009-08-16 13:27:17Z nramsbottom $	
 *
 */

#include <stdio.h>
#include <memory.h>
#include <sys/types.h>

#include "game.h"
#include "display.h"

void display_startup(void) {
	// TODO: Clear the screen before play begins
} //

void display_shutdown(void) {
	// TODO: Clear the screen when play is finished
} //

void display_drawfield(board_t* board) {

	int x, y;
	char token;
	
	printf(" | 1 | 2 | 3 \n");
	printf("=============\n");
	
	// draw rows
	for (x=1;x<4;x++) {
		printf("%d| ", x);
		
		// draw columns
		for (y=1;y<4;y++) {
	
			token = game_getboardtoken(x, y);
			
			if (token == TOKEN_NONE)
				printf(" - ");	// the space is unoccupied by a player token
			else
				printf(" %c ", token);
		}
		printf("\n");
	}
	
} //